(0) Obligation:

Clauses:

goal(X) :- ','(s2t(X, T), tree(T)).
tree(nil) :- !.
tree(X) :- ','(left(T, L), ','(right(T, R), ','(tree(L), tree(R)))).
s2t(0, L) :- ','(!, eq(L, nil)).
s2t(X, node(T, X1, T)) :- ','(p(X, P), s2t(P, T)).
s2t(X, node(nil, X2, T)) :- ','(p(X, P), s2t(P, T)).
s2t(X, node(T, X3, nil)) :- ','(p(X, P), s2t(P, T)).
s2t(X, node(nil, X4, nil)).
left(nil, nil).
left(node(L, X5, X6), L).
right(nil, nil).
right(node(X7, X8, R), R).
p(0, 0).
p(s(X), X).
eq(X, X).

Query: goal(g)

(1) PrologToPrologProblemTransformerProof (SOUND transformation)

Built Prolog problem from termination graph ICLP10.

(2) Obligation:

Clauses:

s2tA(0, nil).
s2tA(s(T20), node(X107, X108, X107)) :- s2tA(T20, X107).
s2tA(s(T28), node(nil, X146, X147)) :- s2tA(T28, X147).
s2tA(s(T36), node(X185, X186, nil)) :- s2tA(T36, X185).
s2tA(T39, node(nil, X202, nil)).
treeB.
treeC(nil).
pD :- treeB.
pD :- ','(treeB, treeB).
pE(X251, X253) :- treeC(X251).
pE(T43, X253) :- ','(treeC(T43), treeC(X253)).
goalF(0) :- treeB.
goalF(s(T11)) :- s2tA(T11, X54).
goalF(s(T11)) :- ','(s2tA(T11, T42), pD).
goalF(s(T11)) :- ','(s2tA(T11, T42), pE(X251, X253)).
goalF(s(T51)) :- s2tA(T51, X285).
goalF(s(T51)) :- ','(s2tA(T51, T55), pD).
goalF(s(T51)) :- ','(s2tA(T51, T55), pE(X343, X345)).
goalF(s(T63)) :- s2tA(T63, X376).
goalF(s(T63)) :- ','(s2tA(T63, T67), pD).
goalF(s(T63)) :- ','(s2tA(T63, T67), pE(X435, X437)).
goalF(T70) :- pD.
goalF(T70) :- pE(X495, X497).

Query: goalF(g)

(3) PrologToPiTRSProof (SOUND transformation)

We use the technique of [TOCL09]. With regard to the inferred argument filtering the predicates were used in the following modes:
goalF_in: (b)
s2tA_in: (b,f)
pE_in: (f,f)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

goalF_in_g(0) → U9_g(treeB_in_)
treeB_in_treeB_out_
U9_g(treeB_out_) → goalF_out_g(0)
goalF_in_g(s(T11)) → U10_g(T11, s2tA_in_ga(T11, X54))
s2tA_in_ga(0, nil) → s2tA_out_ga(0, nil)
s2tA_in_ga(s(T20), node(X107, X108, X107)) → U1_ga(T20, X107, X108, s2tA_in_ga(T20, X107))
s2tA_in_ga(s(T28), node(nil, X146, X147)) → U2_ga(T28, X146, X147, s2tA_in_ga(T28, X147))
s2tA_in_ga(s(T36), node(X185, X186, nil)) → U3_ga(T36, X185, X186, s2tA_in_ga(T36, X185))
s2tA_in_ga(T39, node(nil, X202, nil)) → s2tA_out_ga(T39, node(nil, X202, nil))
U3_ga(T36, X185, X186, s2tA_out_ga(T36, X185)) → s2tA_out_ga(s(T36), node(X185, X186, nil))
U2_ga(T28, X146, X147, s2tA_out_ga(T28, X147)) → s2tA_out_ga(s(T28), node(nil, X146, X147))
U1_ga(T20, X107, X108, s2tA_out_ga(T20, X107)) → s2tA_out_ga(s(T20), node(X107, X108, X107))
U10_g(T11, s2tA_out_ga(T11, X54)) → goalF_out_g(s(T11))
goalF_in_g(s(T11)) → U11_g(T11, s2tA_in_ga(T11, T42))
U11_g(T11, s2tA_out_ga(T11, T42)) → U12_g(T11, pD_in_)
pD_in_U4_(treeB_in_)
U4_(treeB_out_) → pD_out_
U4_(treeB_out_) → U5_(treeB_in_)
U5_(treeB_out_) → pD_out_
U12_g(T11, pD_out_) → goalF_out_g(s(T11))
U11_g(T11, s2tA_out_ga(T11, T42)) → U13_g(T11, pE_in_aa(X251, X253))
pE_in_aa(X251, X253) → U6_aa(X251, X253, treeC_in_a(X251))
treeC_in_a(nil) → treeC_out_a(nil)
U6_aa(X251, X253, treeC_out_a(X251)) → pE_out_aa(X251, X253)
pE_in_aa(T43, X253) → U7_aa(T43, X253, treeC_in_a(T43))
U7_aa(T43, X253, treeC_out_a(T43)) → U8_aa(T43, X253, treeC_in_a(X253))
U8_aa(T43, X253, treeC_out_a(X253)) → pE_out_aa(T43, X253)
U13_g(T11, pE_out_aa(X251, X253)) → goalF_out_g(s(T11))
goalF_in_g(s(T51)) → U14_g(T51, s2tA_in_ga(T51, X285))
U14_g(T51, s2tA_out_ga(T51, X285)) → goalF_out_g(s(T51))
goalF_in_g(s(T51)) → U15_g(T51, s2tA_in_ga(T51, T55))
U15_g(T51, s2tA_out_ga(T51, T55)) → U16_g(T51, pD_in_)
U16_g(T51, pD_out_) → goalF_out_g(s(T51))
U15_g(T51, s2tA_out_ga(T51, T55)) → U17_g(T51, pE_in_aa(X343, X345))
U17_g(T51, pE_out_aa(X343, X345)) → goalF_out_g(s(T51))
goalF_in_g(s(T63)) → U18_g(T63, s2tA_in_ga(T63, X376))
U18_g(T63, s2tA_out_ga(T63, X376)) → goalF_out_g(s(T63))
goalF_in_g(s(T63)) → U19_g(T63, s2tA_in_ga(T63, T67))
U19_g(T63, s2tA_out_ga(T63, T67)) → U20_g(T63, pD_in_)
U20_g(T63, pD_out_) → goalF_out_g(s(T63))
U19_g(T63, s2tA_out_ga(T63, T67)) → U21_g(T63, pE_in_aa(X435, X437))
U21_g(T63, pE_out_aa(X435, X437)) → goalF_out_g(s(T63))
goalF_in_g(T70) → U22_g(T70, pD_in_)
U22_g(T70, pD_out_) → goalF_out_g(T70)
goalF_in_g(T70) → U23_g(T70, pE_in_aa(X495, X497))
U23_g(T70, pE_out_aa(X495, X497)) → goalF_out_g(T70)

The argument filtering Pi contains the following mapping:
goalF_in_g(x1)  =  goalF_in_g(x1)
0  =  0
U9_g(x1)  =  U9_g(x1)
treeB_in_  =  treeB_in_
treeB_out_  =  treeB_out_
goalF_out_g(x1)  =  goalF_out_g
s(x1)  =  s(x1)
U10_g(x1, x2)  =  U10_g(x2)
s2tA_in_ga(x1, x2)  =  s2tA_in_ga(x1)
s2tA_out_ga(x1, x2)  =  s2tA_out_ga(x2)
U1_ga(x1, x2, x3, x4)  =  U1_ga(x4)
U2_ga(x1, x2, x3, x4)  =  U2_ga(x4)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x4)
node(x1, x2, x3)  =  node(x1, x3)
U11_g(x1, x2)  =  U11_g(x2)
U12_g(x1, x2)  =  U12_g(x2)
pD_in_  =  pD_in_
U4_(x1)  =  U4_(x1)
pD_out_  =  pD_out_
U5_(x1)  =  U5_(x1)
U13_g(x1, x2)  =  U13_g(x2)
pE_in_aa(x1, x2)  =  pE_in_aa
U6_aa(x1, x2, x3)  =  U6_aa(x3)
treeC_in_a(x1)  =  treeC_in_a
treeC_out_a(x1)  =  treeC_out_a(x1)
pE_out_aa(x1, x2)  =  pE_out_aa(x1)
U7_aa(x1, x2, x3)  =  U7_aa(x3)
U8_aa(x1, x2, x3)  =  U8_aa(x1, x3)
U14_g(x1, x2)  =  U14_g(x2)
U15_g(x1, x2)  =  U15_g(x2)
U16_g(x1, x2)  =  U16_g(x2)
U17_g(x1, x2)  =  U17_g(x2)
U18_g(x1, x2)  =  U18_g(x2)
U19_g(x1, x2)  =  U19_g(x2)
U20_g(x1, x2)  =  U20_g(x2)
U21_g(x1, x2)  =  U21_g(x2)
U22_g(x1, x2)  =  U22_g(x2)
U23_g(x1, x2)  =  U23_g(x2)
nil  =  nil

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog

(4) Obligation:

Pi-finite rewrite system:
The TRS R consists of the following rules:

goalF_in_g(0) → U9_g(treeB_in_)
treeB_in_treeB_out_
U9_g(treeB_out_) → goalF_out_g(0)
goalF_in_g(s(T11)) → U10_g(T11, s2tA_in_ga(T11, X54))
s2tA_in_ga(0, nil) → s2tA_out_ga(0, nil)
s2tA_in_ga(s(T20), node(X107, X108, X107)) → U1_ga(T20, X107, X108, s2tA_in_ga(T20, X107))
s2tA_in_ga(s(T28), node(nil, X146, X147)) → U2_ga(T28, X146, X147, s2tA_in_ga(T28, X147))
s2tA_in_ga(s(T36), node(X185, X186, nil)) → U3_ga(T36, X185, X186, s2tA_in_ga(T36, X185))
s2tA_in_ga(T39, node(nil, X202, nil)) → s2tA_out_ga(T39, node(nil, X202, nil))
U3_ga(T36, X185, X186, s2tA_out_ga(T36, X185)) → s2tA_out_ga(s(T36), node(X185, X186, nil))
U2_ga(T28, X146, X147, s2tA_out_ga(T28, X147)) → s2tA_out_ga(s(T28), node(nil, X146, X147))
U1_ga(T20, X107, X108, s2tA_out_ga(T20, X107)) → s2tA_out_ga(s(T20), node(X107, X108, X107))
U10_g(T11, s2tA_out_ga(T11, X54)) → goalF_out_g(s(T11))
goalF_in_g(s(T11)) → U11_g(T11, s2tA_in_ga(T11, T42))
U11_g(T11, s2tA_out_ga(T11, T42)) → U12_g(T11, pD_in_)
pD_in_U4_(treeB_in_)
U4_(treeB_out_) → pD_out_
U4_(treeB_out_) → U5_(treeB_in_)
U5_(treeB_out_) → pD_out_
U12_g(T11, pD_out_) → goalF_out_g(s(T11))
U11_g(T11, s2tA_out_ga(T11, T42)) → U13_g(T11, pE_in_aa(X251, X253))
pE_in_aa(X251, X253) → U6_aa(X251, X253, treeC_in_a(X251))
treeC_in_a(nil) → treeC_out_a(nil)
U6_aa(X251, X253, treeC_out_a(X251)) → pE_out_aa(X251, X253)
pE_in_aa(T43, X253) → U7_aa(T43, X253, treeC_in_a(T43))
U7_aa(T43, X253, treeC_out_a(T43)) → U8_aa(T43, X253, treeC_in_a(X253))
U8_aa(T43, X253, treeC_out_a(X253)) → pE_out_aa(T43, X253)
U13_g(T11, pE_out_aa(X251, X253)) → goalF_out_g(s(T11))
goalF_in_g(s(T51)) → U14_g(T51, s2tA_in_ga(T51, X285))
U14_g(T51, s2tA_out_ga(T51, X285)) → goalF_out_g(s(T51))
goalF_in_g(s(T51)) → U15_g(T51, s2tA_in_ga(T51, T55))
U15_g(T51, s2tA_out_ga(T51, T55)) → U16_g(T51, pD_in_)
U16_g(T51, pD_out_) → goalF_out_g(s(T51))
U15_g(T51, s2tA_out_ga(T51, T55)) → U17_g(T51, pE_in_aa(X343, X345))
U17_g(T51, pE_out_aa(X343, X345)) → goalF_out_g(s(T51))
goalF_in_g(s(T63)) → U18_g(T63, s2tA_in_ga(T63, X376))
U18_g(T63, s2tA_out_ga(T63, X376)) → goalF_out_g(s(T63))
goalF_in_g(s(T63)) → U19_g(T63, s2tA_in_ga(T63, T67))
U19_g(T63, s2tA_out_ga(T63, T67)) → U20_g(T63, pD_in_)
U20_g(T63, pD_out_) → goalF_out_g(s(T63))
U19_g(T63, s2tA_out_ga(T63, T67)) → U21_g(T63, pE_in_aa(X435, X437))
U21_g(T63, pE_out_aa(X435, X437)) → goalF_out_g(s(T63))
goalF_in_g(T70) → U22_g(T70, pD_in_)
U22_g(T70, pD_out_) → goalF_out_g(T70)
goalF_in_g(T70) → U23_g(T70, pE_in_aa(X495, X497))
U23_g(T70, pE_out_aa(X495, X497)) → goalF_out_g(T70)

The argument filtering Pi contains the following mapping:
goalF_in_g(x1)  =  goalF_in_g(x1)
0  =  0
U9_g(x1)  =  U9_g(x1)
treeB_in_  =  treeB_in_
treeB_out_  =  treeB_out_
goalF_out_g(x1)  =  goalF_out_g
s(x1)  =  s(x1)
U10_g(x1, x2)  =  U10_g(x2)
s2tA_in_ga(x1, x2)  =  s2tA_in_ga(x1)
s2tA_out_ga(x1, x2)  =  s2tA_out_ga(x2)
U1_ga(x1, x2, x3, x4)  =  U1_ga(x4)
U2_ga(x1, x2, x3, x4)  =  U2_ga(x4)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x4)
node(x1, x2, x3)  =  node(x1, x3)
U11_g(x1, x2)  =  U11_g(x2)
U12_g(x1, x2)  =  U12_g(x2)
pD_in_  =  pD_in_
U4_(x1)  =  U4_(x1)
pD_out_  =  pD_out_
U5_(x1)  =  U5_(x1)
U13_g(x1, x2)  =  U13_g(x2)
pE_in_aa(x1, x2)  =  pE_in_aa
U6_aa(x1, x2, x3)  =  U6_aa(x3)
treeC_in_a(x1)  =  treeC_in_a
treeC_out_a(x1)  =  treeC_out_a(x1)
pE_out_aa(x1, x2)  =  pE_out_aa(x1)
U7_aa(x1, x2, x3)  =  U7_aa(x3)
U8_aa(x1, x2, x3)  =  U8_aa(x1, x3)
U14_g(x1, x2)  =  U14_g(x2)
U15_g(x1, x2)  =  U15_g(x2)
U16_g(x1, x2)  =  U16_g(x2)
U17_g(x1, x2)  =  U17_g(x2)
U18_g(x1, x2)  =  U18_g(x2)
U19_g(x1, x2)  =  U19_g(x2)
U20_g(x1, x2)  =  U20_g(x2)
U21_g(x1, x2)  =  U21_g(x2)
U22_g(x1, x2)  =  U22_g(x2)
U23_g(x1, x2)  =  U23_g(x2)
nil  =  nil

(5) DependencyPairsProof (EQUIVALENT transformation)

Using Dependency Pairs [AG00,LOPSTR] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

GOALF_IN_G(0) → U9_G(treeB_in_)
GOALF_IN_G(0) → TREEB_IN_
GOALF_IN_G(s(T11)) → U10_G(T11, s2tA_in_ga(T11, X54))
GOALF_IN_G(s(T11)) → S2TA_IN_GA(T11, X54)
S2TA_IN_GA(s(T20), node(X107, X108, X107)) → U1_GA(T20, X107, X108, s2tA_in_ga(T20, X107))
S2TA_IN_GA(s(T20), node(X107, X108, X107)) → S2TA_IN_GA(T20, X107)
S2TA_IN_GA(s(T28), node(nil, X146, X147)) → U2_GA(T28, X146, X147, s2tA_in_ga(T28, X147))
S2TA_IN_GA(s(T28), node(nil, X146, X147)) → S2TA_IN_GA(T28, X147)
S2TA_IN_GA(s(T36), node(X185, X186, nil)) → U3_GA(T36, X185, X186, s2tA_in_ga(T36, X185))
S2TA_IN_GA(s(T36), node(X185, X186, nil)) → S2TA_IN_GA(T36, X185)
GOALF_IN_G(s(T11)) → U11_G(T11, s2tA_in_ga(T11, T42))
U11_G(T11, s2tA_out_ga(T11, T42)) → U12_G(T11, pD_in_)
U11_G(T11, s2tA_out_ga(T11, T42)) → PD_IN_
PD_IN_U4_1(treeB_in_)
PD_IN_TREEB_IN_
U4_1(treeB_out_) → U5_1(treeB_in_)
U4_1(treeB_out_) → TREEB_IN_
U11_G(T11, s2tA_out_ga(T11, T42)) → U13_G(T11, pE_in_aa(X251, X253))
U11_G(T11, s2tA_out_ga(T11, T42)) → PE_IN_AA(X251, X253)
PE_IN_AA(X251, X253) → U6_AA(X251, X253, treeC_in_a(X251))
PE_IN_AA(X251, X253) → TREEC_IN_A(X251)
PE_IN_AA(T43, X253) → U7_AA(T43, X253, treeC_in_a(T43))
U7_AA(T43, X253, treeC_out_a(T43)) → U8_AA(T43, X253, treeC_in_a(X253))
U7_AA(T43, X253, treeC_out_a(T43)) → TREEC_IN_A(X253)
GOALF_IN_G(s(T51)) → U14_G(T51, s2tA_in_ga(T51, X285))
GOALF_IN_G(s(T51)) → U15_G(T51, s2tA_in_ga(T51, T55))
U15_G(T51, s2tA_out_ga(T51, T55)) → U16_G(T51, pD_in_)
U15_G(T51, s2tA_out_ga(T51, T55)) → PD_IN_
U15_G(T51, s2tA_out_ga(T51, T55)) → U17_G(T51, pE_in_aa(X343, X345))
U15_G(T51, s2tA_out_ga(T51, T55)) → PE_IN_AA(X343, X345)
GOALF_IN_G(s(T63)) → U18_G(T63, s2tA_in_ga(T63, X376))
GOALF_IN_G(s(T63)) → U19_G(T63, s2tA_in_ga(T63, T67))
U19_G(T63, s2tA_out_ga(T63, T67)) → U20_G(T63, pD_in_)
U19_G(T63, s2tA_out_ga(T63, T67)) → PD_IN_
U19_G(T63, s2tA_out_ga(T63, T67)) → U21_G(T63, pE_in_aa(X435, X437))
U19_G(T63, s2tA_out_ga(T63, T67)) → PE_IN_AA(X435, X437)
GOALF_IN_G(T70) → U22_G(T70, pD_in_)
GOALF_IN_G(T70) → PD_IN_
GOALF_IN_G(T70) → U23_G(T70, pE_in_aa(X495, X497))
GOALF_IN_G(T70) → PE_IN_AA(X495, X497)

The TRS R consists of the following rules:

goalF_in_g(0) → U9_g(treeB_in_)
treeB_in_treeB_out_
U9_g(treeB_out_) → goalF_out_g(0)
goalF_in_g(s(T11)) → U10_g(T11, s2tA_in_ga(T11, X54))
s2tA_in_ga(0, nil) → s2tA_out_ga(0, nil)
s2tA_in_ga(s(T20), node(X107, X108, X107)) → U1_ga(T20, X107, X108, s2tA_in_ga(T20, X107))
s2tA_in_ga(s(T28), node(nil, X146, X147)) → U2_ga(T28, X146, X147, s2tA_in_ga(T28, X147))
s2tA_in_ga(s(T36), node(X185, X186, nil)) → U3_ga(T36, X185, X186, s2tA_in_ga(T36, X185))
s2tA_in_ga(T39, node(nil, X202, nil)) → s2tA_out_ga(T39, node(nil, X202, nil))
U3_ga(T36, X185, X186, s2tA_out_ga(T36, X185)) → s2tA_out_ga(s(T36), node(X185, X186, nil))
U2_ga(T28, X146, X147, s2tA_out_ga(T28, X147)) → s2tA_out_ga(s(T28), node(nil, X146, X147))
U1_ga(T20, X107, X108, s2tA_out_ga(T20, X107)) → s2tA_out_ga(s(T20), node(X107, X108, X107))
U10_g(T11, s2tA_out_ga(T11, X54)) → goalF_out_g(s(T11))
goalF_in_g(s(T11)) → U11_g(T11, s2tA_in_ga(T11, T42))
U11_g(T11, s2tA_out_ga(T11, T42)) → U12_g(T11, pD_in_)
pD_in_U4_(treeB_in_)
U4_(treeB_out_) → pD_out_
U4_(treeB_out_) → U5_(treeB_in_)
U5_(treeB_out_) → pD_out_
U12_g(T11, pD_out_) → goalF_out_g(s(T11))
U11_g(T11, s2tA_out_ga(T11, T42)) → U13_g(T11, pE_in_aa(X251, X253))
pE_in_aa(X251, X253) → U6_aa(X251, X253, treeC_in_a(X251))
treeC_in_a(nil) → treeC_out_a(nil)
U6_aa(X251, X253, treeC_out_a(X251)) → pE_out_aa(X251, X253)
pE_in_aa(T43, X253) → U7_aa(T43, X253, treeC_in_a(T43))
U7_aa(T43, X253, treeC_out_a(T43)) → U8_aa(T43, X253, treeC_in_a(X253))
U8_aa(T43, X253, treeC_out_a(X253)) → pE_out_aa(T43, X253)
U13_g(T11, pE_out_aa(X251, X253)) → goalF_out_g(s(T11))
goalF_in_g(s(T51)) → U14_g(T51, s2tA_in_ga(T51, X285))
U14_g(T51, s2tA_out_ga(T51, X285)) → goalF_out_g(s(T51))
goalF_in_g(s(T51)) → U15_g(T51, s2tA_in_ga(T51, T55))
U15_g(T51, s2tA_out_ga(T51, T55)) → U16_g(T51, pD_in_)
U16_g(T51, pD_out_) → goalF_out_g(s(T51))
U15_g(T51, s2tA_out_ga(T51, T55)) → U17_g(T51, pE_in_aa(X343, X345))
U17_g(T51, pE_out_aa(X343, X345)) → goalF_out_g(s(T51))
goalF_in_g(s(T63)) → U18_g(T63, s2tA_in_ga(T63, X376))
U18_g(T63, s2tA_out_ga(T63, X376)) → goalF_out_g(s(T63))
goalF_in_g(s(T63)) → U19_g(T63, s2tA_in_ga(T63, T67))
U19_g(T63, s2tA_out_ga(T63, T67)) → U20_g(T63, pD_in_)
U20_g(T63, pD_out_) → goalF_out_g(s(T63))
U19_g(T63, s2tA_out_ga(T63, T67)) → U21_g(T63, pE_in_aa(X435, X437))
U21_g(T63, pE_out_aa(X435, X437)) → goalF_out_g(s(T63))
goalF_in_g(T70) → U22_g(T70, pD_in_)
U22_g(T70, pD_out_) → goalF_out_g(T70)
goalF_in_g(T70) → U23_g(T70, pE_in_aa(X495, X497))
U23_g(T70, pE_out_aa(X495, X497)) → goalF_out_g(T70)

The argument filtering Pi contains the following mapping:
goalF_in_g(x1)  =  goalF_in_g(x1)
0  =  0
U9_g(x1)  =  U9_g(x1)
treeB_in_  =  treeB_in_
treeB_out_  =  treeB_out_
goalF_out_g(x1)  =  goalF_out_g
s(x1)  =  s(x1)
U10_g(x1, x2)  =  U10_g(x2)
s2tA_in_ga(x1, x2)  =  s2tA_in_ga(x1)
s2tA_out_ga(x1, x2)  =  s2tA_out_ga(x2)
U1_ga(x1, x2, x3, x4)  =  U1_ga(x4)
U2_ga(x1, x2, x3, x4)  =  U2_ga(x4)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x4)
node(x1, x2, x3)  =  node(x1, x3)
U11_g(x1, x2)  =  U11_g(x2)
U12_g(x1, x2)  =  U12_g(x2)
pD_in_  =  pD_in_
U4_(x1)  =  U4_(x1)
pD_out_  =  pD_out_
U5_(x1)  =  U5_(x1)
U13_g(x1, x2)  =  U13_g(x2)
pE_in_aa(x1, x2)  =  pE_in_aa
U6_aa(x1, x2, x3)  =  U6_aa(x3)
treeC_in_a(x1)  =  treeC_in_a
treeC_out_a(x1)  =  treeC_out_a(x1)
pE_out_aa(x1, x2)  =  pE_out_aa(x1)
U7_aa(x1, x2, x3)  =  U7_aa(x3)
U8_aa(x1, x2, x3)  =  U8_aa(x1, x3)
U14_g(x1, x2)  =  U14_g(x2)
U15_g(x1, x2)  =  U15_g(x2)
U16_g(x1, x2)  =  U16_g(x2)
U17_g(x1, x2)  =  U17_g(x2)
U18_g(x1, x2)  =  U18_g(x2)
U19_g(x1, x2)  =  U19_g(x2)
U20_g(x1, x2)  =  U20_g(x2)
U21_g(x1, x2)  =  U21_g(x2)
U22_g(x1, x2)  =  U22_g(x2)
U23_g(x1, x2)  =  U23_g(x2)
nil  =  nil
GOALF_IN_G(x1)  =  GOALF_IN_G(x1)
U9_G(x1)  =  U9_G(x1)
TREEB_IN_  =  TREEB_IN_
U10_G(x1, x2)  =  U10_G(x2)
S2TA_IN_GA(x1, x2)  =  S2TA_IN_GA(x1)
U1_GA(x1, x2, x3, x4)  =  U1_GA(x4)
U2_GA(x1, x2, x3, x4)  =  U2_GA(x4)
U3_GA(x1, x2, x3, x4)  =  U3_GA(x4)
U11_G(x1, x2)  =  U11_G(x2)
U12_G(x1, x2)  =  U12_G(x2)
PD_IN_  =  PD_IN_
U4_1(x1)  =  U4_1(x1)
U5_1(x1)  =  U5_1(x1)
U13_G(x1, x2)  =  U13_G(x2)
PE_IN_AA(x1, x2)  =  PE_IN_AA
U6_AA(x1, x2, x3)  =  U6_AA(x3)
TREEC_IN_A(x1)  =  TREEC_IN_A
U7_AA(x1, x2, x3)  =  U7_AA(x3)
U8_AA(x1, x2, x3)  =  U8_AA(x1, x3)
U14_G(x1, x2)  =  U14_G(x2)
U15_G(x1, x2)  =  U15_G(x2)
U16_G(x1, x2)  =  U16_G(x2)
U17_G(x1, x2)  =  U17_G(x2)
U18_G(x1, x2)  =  U18_G(x2)
U19_G(x1, x2)  =  U19_G(x2)
U20_G(x1, x2)  =  U20_G(x2)
U21_G(x1, x2)  =  U21_G(x2)
U22_G(x1, x2)  =  U22_G(x2)
U23_G(x1, x2)  =  U23_G(x2)

We have to consider all (P,R,Pi)-chains

(6) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

GOALF_IN_G(0) → U9_G(treeB_in_)
GOALF_IN_G(0) → TREEB_IN_
GOALF_IN_G(s(T11)) → U10_G(T11, s2tA_in_ga(T11, X54))
GOALF_IN_G(s(T11)) → S2TA_IN_GA(T11, X54)
S2TA_IN_GA(s(T20), node(X107, X108, X107)) → U1_GA(T20, X107, X108, s2tA_in_ga(T20, X107))
S2TA_IN_GA(s(T20), node(X107, X108, X107)) → S2TA_IN_GA(T20, X107)
S2TA_IN_GA(s(T28), node(nil, X146, X147)) → U2_GA(T28, X146, X147, s2tA_in_ga(T28, X147))
S2TA_IN_GA(s(T28), node(nil, X146, X147)) → S2TA_IN_GA(T28, X147)
S2TA_IN_GA(s(T36), node(X185, X186, nil)) → U3_GA(T36, X185, X186, s2tA_in_ga(T36, X185))
S2TA_IN_GA(s(T36), node(X185, X186, nil)) → S2TA_IN_GA(T36, X185)
GOALF_IN_G(s(T11)) → U11_G(T11, s2tA_in_ga(T11, T42))
U11_G(T11, s2tA_out_ga(T11, T42)) → U12_G(T11, pD_in_)
U11_G(T11, s2tA_out_ga(T11, T42)) → PD_IN_
PD_IN_U4_1(treeB_in_)
PD_IN_TREEB_IN_
U4_1(treeB_out_) → U5_1(treeB_in_)
U4_1(treeB_out_) → TREEB_IN_
U11_G(T11, s2tA_out_ga(T11, T42)) → U13_G(T11, pE_in_aa(X251, X253))
U11_G(T11, s2tA_out_ga(T11, T42)) → PE_IN_AA(X251, X253)
PE_IN_AA(X251, X253) → U6_AA(X251, X253, treeC_in_a(X251))
PE_IN_AA(X251, X253) → TREEC_IN_A(X251)
PE_IN_AA(T43, X253) → U7_AA(T43, X253, treeC_in_a(T43))
U7_AA(T43, X253, treeC_out_a(T43)) → U8_AA(T43, X253, treeC_in_a(X253))
U7_AA(T43, X253, treeC_out_a(T43)) → TREEC_IN_A(X253)
GOALF_IN_G(s(T51)) → U14_G(T51, s2tA_in_ga(T51, X285))
GOALF_IN_G(s(T51)) → U15_G(T51, s2tA_in_ga(T51, T55))
U15_G(T51, s2tA_out_ga(T51, T55)) → U16_G(T51, pD_in_)
U15_G(T51, s2tA_out_ga(T51, T55)) → PD_IN_
U15_G(T51, s2tA_out_ga(T51, T55)) → U17_G(T51, pE_in_aa(X343, X345))
U15_G(T51, s2tA_out_ga(T51, T55)) → PE_IN_AA(X343, X345)
GOALF_IN_G(s(T63)) → U18_G(T63, s2tA_in_ga(T63, X376))
GOALF_IN_G(s(T63)) → U19_G(T63, s2tA_in_ga(T63, T67))
U19_G(T63, s2tA_out_ga(T63, T67)) → U20_G(T63, pD_in_)
U19_G(T63, s2tA_out_ga(T63, T67)) → PD_IN_
U19_G(T63, s2tA_out_ga(T63, T67)) → U21_G(T63, pE_in_aa(X435, X437))
U19_G(T63, s2tA_out_ga(T63, T67)) → PE_IN_AA(X435, X437)
GOALF_IN_G(T70) → U22_G(T70, pD_in_)
GOALF_IN_G(T70) → PD_IN_
GOALF_IN_G(T70) → U23_G(T70, pE_in_aa(X495, X497))
GOALF_IN_G(T70) → PE_IN_AA(X495, X497)

The TRS R consists of the following rules:

goalF_in_g(0) → U9_g(treeB_in_)
treeB_in_treeB_out_
U9_g(treeB_out_) → goalF_out_g(0)
goalF_in_g(s(T11)) → U10_g(T11, s2tA_in_ga(T11, X54))
s2tA_in_ga(0, nil) → s2tA_out_ga(0, nil)
s2tA_in_ga(s(T20), node(X107, X108, X107)) → U1_ga(T20, X107, X108, s2tA_in_ga(T20, X107))
s2tA_in_ga(s(T28), node(nil, X146, X147)) → U2_ga(T28, X146, X147, s2tA_in_ga(T28, X147))
s2tA_in_ga(s(T36), node(X185, X186, nil)) → U3_ga(T36, X185, X186, s2tA_in_ga(T36, X185))
s2tA_in_ga(T39, node(nil, X202, nil)) → s2tA_out_ga(T39, node(nil, X202, nil))
U3_ga(T36, X185, X186, s2tA_out_ga(T36, X185)) → s2tA_out_ga(s(T36), node(X185, X186, nil))
U2_ga(T28, X146, X147, s2tA_out_ga(T28, X147)) → s2tA_out_ga(s(T28), node(nil, X146, X147))
U1_ga(T20, X107, X108, s2tA_out_ga(T20, X107)) → s2tA_out_ga(s(T20), node(X107, X108, X107))
U10_g(T11, s2tA_out_ga(T11, X54)) → goalF_out_g(s(T11))
goalF_in_g(s(T11)) → U11_g(T11, s2tA_in_ga(T11, T42))
U11_g(T11, s2tA_out_ga(T11, T42)) → U12_g(T11, pD_in_)
pD_in_U4_(treeB_in_)
U4_(treeB_out_) → pD_out_
U4_(treeB_out_) → U5_(treeB_in_)
U5_(treeB_out_) → pD_out_
U12_g(T11, pD_out_) → goalF_out_g(s(T11))
U11_g(T11, s2tA_out_ga(T11, T42)) → U13_g(T11, pE_in_aa(X251, X253))
pE_in_aa(X251, X253) → U6_aa(X251, X253, treeC_in_a(X251))
treeC_in_a(nil) → treeC_out_a(nil)
U6_aa(X251, X253, treeC_out_a(X251)) → pE_out_aa(X251, X253)
pE_in_aa(T43, X253) → U7_aa(T43, X253, treeC_in_a(T43))
U7_aa(T43, X253, treeC_out_a(T43)) → U8_aa(T43, X253, treeC_in_a(X253))
U8_aa(T43, X253, treeC_out_a(X253)) → pE_out_aa(T43, X253)
U13_g(T11, pE_out_aa(X251, X253)) → goalF_out_g(s(T11))
goalF_in_g(s(T51)) → U14_g(T51, s2tA_in_ga(T51, X285))
U14_g(T51, s2tA_out_ga(T51, X285)) → goalF_out_g(s(T51))
goalF_in_g(s(T51)) → U15_g(T51, s2tA_in_ga(T51, T55))
U15_g(T51, s2tA_out_ga(T51, T55)) → U16_g(T51, pD_in_)
U16_g(T51, pD_out_) → goalF_out_g(s(T51))
U15_g(T51, s2tA_out_ga(T51, T55)) → U17_g(T51, pE_in_aa(X343, X345))
U17_g(T51, pE_out_aa(X343, X345)) → goalF_out_g(s(T51))
goalF_in_g(s(T63)) → U18_g(T63, s2tA_in_ga(T63, X376))
U18_g(T63, s2tA_out_ga(T63, X376)) → goalF_out_g(s(T63))
goalF_in_g(s(T63)) → U19_g(T63, s2tA_in_ga(T63, T67))
U19_g(T63, s2tA_out_ga(T63, T67)) → U20_g(T63, pD_in_)
U20_g(T63, pD_out_) → goalF_out_g(s(T63))
U19_g(T63, s2tA_out_ga(T63, T67)) → U21_g(T63, pE_in_aa(X435, X437))
U21_g(T63, pE_out_aa(X435, X437)) → goalF_out_g(s(T63))
goalF_in_g(T70) → U22_g(T70, pD_in_)
U22_g(T70, pD_out_) → goalF_out_g(T70)
goalF_in_g(T70) → U23_g(T70, pE_in_aa(X495, X497))
U23_g(T70, pE_out_aa(X495, X497)) → goalF_out_g(T70)

The argument filtering Pi contains the following mapping:
goalF_in_g(x1)  =  goalF_in_g(x1)
0  =  0
U9_g(x1)  =  U9_g(x1)
treeB_in_  =  treeB_in_
treeB_out_  =  treeB_out_
goalF_out_g(x1)  =  goalF_out_g
s(x1)  =  s(x1)
U10_g(x1, x2)  =  U10_g(x2)
s2tA_in_ga(x1, x2)  =  s2tA_in_ga(x1)
s2tA_out_ga(x1, x2)  =  s2tA_out_ga(x2)
U1_ga(x1, x2, x3, x4)  =  U1_ga(x4)
U2_ga(x1, x2, x3, x4)  =  U2_ga(x4)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x4)
node(x1, x2, x3)  =  node(x1, x3)
U11_g(x1, x2)  =  U11_g(x2)
U12_g(x1, x2)  =  U12_g(x2)
pD_in_  =  pD_in_
U4_(x1)  =  U4_(x1)
pD_out_  =  pD_out_
U5_(x1)  =  U5_(x1)
U13_g(x1, x2)  =  U13_g(x2)
pE_in_aa(x1, x2)  =  pE_in_aa
U6_aa(x1, x2, x3)  =  U6_aa(x3)
treeC_in_a(x1)  =  treeC_in_a
treeC_out_a(x1)  =  treeC_out_a(x1)
pE_out_aa(x1, x2)  =  pE_out_aa(x1)
U7_aa(x1, x2, x3)  =  U7_aa(x3)
U8_aa(x1, x2, x3)  =  U8_aa(x1, x3)
U14_g(x1, x2)  =  U14_g(x2)
U15_g(x1, x2)  =  U15_g(x2)
U16_g(x1, x2)  =  U16_g(x2)
U17_g(x1, x2)  =  U17_g(x2)
U18_g(x1, x2)  =  U18_g(x2)
U19_g(x1, x2)  =  U19_g(x2)
U20_g(x1, x2)  =  U20_g(x2)
U21_g(x1, x2)  =  U21_g(x2)
U22_g(x1, x2)  =  U22_g(x2)
U23_g(x1, x2)  =  U23_g(x2)
nil  =  nil
GOALF_IN_G(x1)  =  GOALF_IN_G(x1)
U9_G(x1)  =  U9_G(x1)
TREEB_IN_  =  TREEB_IN_
U10_G(x1, x2)  =  U10_G(x2)
S2TA_IN_GA(x1, x2)  =  S2TA_IN_GA(x1)
U1_GA(x1, x2, x3, x4)  =  U1_GA(x4)
U2_GA(x1, x2, x3, x4)  =  U2_GA(x4)
U3_GA(x1, x2, x3, x4)  =  U3_GA(x4)
U11_G(x1, x2)  =  U11_G(x2)
U12_G(x1, x2)  =  U12_G(x2)
PD_IN_  =  PD_IN_
U4_1(x1)  =  U4_1(x1)
U5_1(x1)  =  U5_1(x1)
U13_G(x1, x2)  =  U13_G(x2)
PE_IN_AA(x1, x2)  =  PE_IN_AA
U6_AA(x1, x2, x3)  =  U6_AA(x3)
TREEC_IN_A(x1)  =  TREEC_IN_A
U7_AA(x1, x2, x3)  =  U7_AA(x3)
U8_AA(x1, x2, x3)  =  U8_AA(x1, x3)
U14_G(x1, x2)  =  U14_G(x2)
U15_G(x1, x2)  =  U15_G(x2)
U16_G(x1, x2)  =  U16_G(x2)
U17_G(x1, x2)  =  U17_G(x2)
U18_G(x1, x2)  =  U18_G(x2)
U19_G(x1, x2)  =  U19_G(x2)
U20_G(x1, x2)  =  U20_G(x2)
U21_G(x1, x2)  =  U21_G(x2)
U22_G(x1, x2)  =  U22_G(x2)
U23_G(x1, x2)  =  U23_G(x2)

We have to consider all (P,R,Pi)-chains

(7) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LOPSTR] contains 1 SCC with 37 less nodes.

(8) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

S2TA_IN_GA(s(T28), node(nil, X146, X147)) → S2TA_IN_GA(T28, X147)
S2TA_IN_GA(s(T20), node(X107, X108, X107)) → S2TA_IN_GA(T20, X107)
S2TA_IN_GA(s(T36), node(X185, X186, nil)) → S2TA_IN_GA(T36, X185)

The TRS R consists of the following rules:

goalF_in_g(0) → U9_g(treeB_in_)
treeB_in_treeB_out_
U9_g(treeB_out_) → goalF_out_g(0)
goalF_in_g(s(T11)) → U10_g(T11, s2tA_in_ga(T11, X54))
s2tA_in_ga(0, nil) → s2tA_out_ga(0, nil)
s2tA_in_ga(s(T20), node(X107, X108, X107)) → U1_ga(T20, X107, X108, s2tA_in_ga(T20, X107))
s2tA_in_ga(s(T28), node(nil, X146, X147)) → U2_ga(T28, X146, X147, s2tA_in_ga(T28, X147))
s2tA_in_ga(s(T36), node(X185, X186, nil)) → U3_ga(T36, X185, X186, s2tA_in_ga(T36, X185))
s2tA_in_ga(T39, node(nil, X202, nil)) → s2tA_out_ga(T39, node(nil, X202, nil))
U3_ga(T36, X185, X186, s2tA_out_ga(T36, X185)) → s2tA_out_ga(s(T36), node(X185, X186, nil))
U2_ga(T28, X146, X147, s2tA_out_ga(T28, X147)) → s2tA_out_ga(s(T28), node(nil, X146, X147))
U1_ga(T20, X107, X108, s2tA_out_ga(T20, X107)) → s2tA_out_ga(s(T20), node(X107, X108, X107))
U10_g(T11, s2tA_out_ga(T11, X54)) → goalF_out_g(s(T11))
goalF_in_g(s(T11)) → U11_g(T11, s2tA_in_ga(T11, T42))
U11_g(T11, s2tA_out_ga(T11, T42)) → U12_g(T11, pD_in_)
pD_in_U4_(treeB_in_)
U4_(treeB_out_) → pD_out_
U4_(treeB_out_) → U5_(treeB_in_)
U5_(treeB_out_) → pD_out_
U12_g(T11, pD_out_) → goalF_out_g(s(T11))
U11_g(T11, s2tA_out_ga(T11, T42)) → U13_g(T11, pE_in_aa(X251, X253))
pE_in_aa(X251, X253) → U6_aa(X251, X253, treeC_in_a(X251))
treeC_in_a(nil) → treeC_out_a(nil)
U6_aa(X251, X253, treeC_out_a(X251)) → pE_out_aa(X251, X253)
pE_in_aa(T43, X253) → U7_aa(T43, X253, treeC_in_a(T43))
U7_aa(T43, X253, treeC_out_a(T43)) → U8_aa(T43, X253, treeC_in_a(X253))
U8_aa(T43, X253, treeC_out_a(X253)) → pE_out_aa(T43, X253)
U13_g(T11, pE_out_aa(X251, X253)) → goalF_out_g(s(T11))
goalF_in_g(s(T51)) → U14_g(T51, s2tA_in_ga(T51, X285))
U14_g(T51, s2tA_out_ga(T51, X285)) → goalF_out_g(s(T51))
goalF_in_g(s(T51)) → U15_g(T51, s2tA_in_ga(T51, T55))
U15_g(T51, s2tA_out_ga(T51, T55)) → U16_g(T51, pD_in_)
U16_g(T51, pD_out_) → goalF_out_g(s(T51))
U15_g(T51, s2tA_out_ga(T51, T55)) → U17_g(T51, pE_in_aa(X343, X345))
U17_g(T51, pE_out_aa(X343, X345)) → goalF_out_g(s(T51))
goalF_in_g(s(T63)) → U18_g(T63, s2tA_in_ga(T63, X376))
U18_g(T63, s2tA_out_ga(T63, X376)) → goalF_out_g(s(T63))
goalF_in_g(s(T63)) → U19_g(T63, s2tA_in_ga(T63, T67))
U19_g(T63, s2tA_out_ga(T63, T67)) → U20_g(T63, pD_in_)
U20_g(T63, pD_out_) → goalF_out_g(s(T63))
U19_g(T63, s2tA_out_ga(T63, T67)) → U21_g(T63, pE_in_aa(X435, X437))
U21_g(T63, pE_out_aa(X435, X437)) → goalF_out_g(s(T63))
goalF_in_g(T70) → U22_g(T70, pD_in_)
U22_g(T70, pD_out_) → goalF_out_g(T70)
goalF_in_g(T70) → U23_g(T70, pE_in_aa(X495, X497))
U23_g(T70, pE_out_aa(X495, X497)) → goalF_out_g(T70)

The argument filtering Pi contains the following mapping:
goalF_in_g(x1)  =  goalF_in_g(x1)
0  =  0
U9_g(x1)  =  U9_g(x1)
treeB_in_  =  treeB_in_
treeB_out_  =  treeB_out_
goalF_out_g(x1)  =  goalF_out_g
s(x1)  =  s(x1)
U10_g(x1, x2)  =  U10_g(x2)
s2tA_in_ga(x1, x2)  =  s2tA_in_ga(x1)
s2tA_out_ga(x1, x2)  =  s2tA_out_ga(x2)
U1_ga(x1, x2, x3, x4)  =  U1_ga(x4)
U2_ga(x1, x2, x3, x4)  =  U2_ga(x4)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x4)
node(x1, x2, x3)  =  node(x1, x3)
U11_g(x1, x2)  =  U11_g(x2)
U12_g(x1, x2)  =  U12_g(x2)
pD_in_  =  pD_in_
U4_(x1)  =  U4_(x1)
pD_out_  =  pD_out_
U5_(x1)  =  U5_(x1)
U13_g(x1, x2)  =  U13_g(x2)
pE_in_aa(x1, x2)  =  pE_in_aa
U6_aa(x1, x2, x3)  =  U6_aa(x3)
treeC_in_a(x1)  =  treeC_in_a
treeC_out_a(x1)  =  treeC_out_a(x1)
pE_out_aa(x1, x2)  =  pE_out_aa(x1)
U7_aa(x1, x2, x3)  =  U7_aa(x3)
U8_aa(x1, x2, x3)  =  U8_aa(x1, x3)
U14_g(x1, x2)  =  U14_g(x2)
U15_g(x1, x2)  =  U15_g(x2)
U16_g(x1, x2)  =  U16_g(x2)
U17_g(x1, x2)  =  U17_g(x2)
U18_g(x1, x2)  =  U18_g(x2)
U19_g(x1, x2)  =  U19_g(x2)
U20_g(x1, x2)  =  U20_g(x2)
U21_g(x1, x2)  =  U21_g(x2)
U22_g(x1, x2)  =  U22_g(x2)
U23_g(x1, x2)  =  U23_g(x2)
nil  =  nil
S2TA_IN_GA(x1, x2)  =  S2TA_IN_GA(x1)

We have to consider all (P,R,Pi)-chains

(9) UsableRulesProof (EQUIVALENT transformation)

For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.

(10) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

S2TA_IN_GA(s(T28), node(nil, X146, X147)) → S2TA_IN_GA(T28, X147)
S2TA_IN_GA(s(T20), node(X107, X108, X107)) → S2TA_IN_GA(T20, X107)
S2TA_IN_GA(s(T36), node(X185, X186, nil)) → S2TA_IN_GA(T36, X185)

R is empty.
The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
node(x1, x2, x3)  =  node(x1, x3)
nil  =  nil
S2TA_IN_GA(x1, x2)  =  S2TA_IN_GA(x1)

We have to consider all (P,R,Pi)-chains

(11) PiDPToQDPProof (SOUND transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(12) Obligation:

Q DP problem:
The TRS P consists of the following rules:

S2TA_IN_GA(s(T28)) → S2TA_IN_GA(T28)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.

(13) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:

  • S2TA_IN_GA(s(T28)) → S2TA_IN_GA(T28)
    The graph contains the following edges 1 > 1

(14) YES